package com.spring.boot.demo.controller;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhuYouBin
 * @version 1.0.0
 * @Date: 2022/10/31 22:15
 * @Description
 */
// 设置允许跨域访问
//@CrossOrigin
// 可以指定具体的跨域访问地址
//@CrossOrigin(origins = {"http://localhost:63344"})
@RestController
@RequestMapping("/api/cors")
public class CorsController {

    @GetMapping("/demo")
    public String corsDemo() {
        return "cors跨域请求成功";
    }

}
